using System;
using System.Collections.Generic;
using System.Media;
using System.Threading;
using System.Windows.Forms;

namespace ClownStopper
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                try
                {

                    var sndplayr = new SoundPlayer(Properties.Resources.clown);
                    sndplayr.Play();
                    Thread.Sleep(700);

                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + ": " + ex.StackTrace, "Error");
                }
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                bool isServer = bool.Parse(System.Configuration.ConfigurationManager.AppSettings["IsServer"]); ;

                Application.Run(new frmMain(isServer));
            }
        }
    }
}